var canvas = null; 
var ctx = null;


//init canvas
function init()
{
	canvas = document.getElementsByTagName('canvas')[0];
	ctx = canvas.getContext('2d');
	
	loadSprites();
}

function loadSprites()
{
	
	//Player sprites (the car)
	for(i=0;i<3;i++)
	{
		var img = new Image();
		img.src = "player"+i+".png";
		player_img_array.push(img);
	}
	
	for(i=0;i<2;i++)
	{
		var img = new Image();
		img.src = "road"+i+".png";
		road_img_array.push(img);
	}
	
}

//clear canvas
function reset(){ctx.clearRect(0,0,CANVAS_MAX_X,CANVAS_MAX_Y);}

